package org.example.myleet.rosalind.sseq;

import org.example.myleet.rosalind.utils.FastaReader;

public class Solution {
    public static void main(String[] args) {
        Solution solution = new Solution();
//        solution.findOneSubSequenceIndices("ACGTACGTGACG", "GTA");
        solution.findOneSubSequenceIndices(FastaReader.parseFastaInput(">Rosalind_3689\n" +
                "GGAAACTACCGTGGGGAATAATTCCTACCAATTCTAGGACACCAGTGAATTCCAATTTGA\n" +
                "ACGTCGGGTGACGAGCTATCGCTTTATACCAAGAGGAAGACGGTAATATGTATCGTCTAG\n" +
                "GAGACGACGAACAAGTCATTCTCTCAATGTCTCCAGAGACGAAGGGCCTCCGGTTACTGC\n" +
                "TAGCCATCTATTCCGAACCCGTGGACCGCCGACCTCTTTAGGATACCGTAGATCGCGGCA\n" +
                "AGTGCCAACTGTCGCCACGGAGCACCGAATTAAGTATTCTTATCCAACATTTCTCACGGA\n" +
                "AGTACGCTAAGAATGGCATTCACCACTAGGCTCAAACAGCGGGTCTGGGTCCTTAATTGT\n" +
                "AAGTCTAGGTCAGCGCCAACACCCTGTAGAAGCTGCAACCGGACTATGGCGACCAGAGCG\n" +
                "GACTTTGACTCTCTCCCTGGCACCCGTGGATACAGAGTCGCACAAGTTCAAAGGAACTTA\n" +
                "ACTTGATTCGGAGCTAATCTTTCGGATGTCTTAACGTCCTTGCTGCAATAAGTGACGGCC\n" +
                "TGACACCTTCAAGGCATTGCTGTCTTGCATTAGTTCAGGGCTATCCTAGTGCTTTACAAC\n" +
                "CGTAACGTTTTACGGGTCATCACAGTGACTTGTATATGCTGGGCAATTACAAAAGCGGAC\n" +
                "CTCAGTTGGTCGAGATTGTATTTGGGGGTGAATCTCTTCCATGACCACGCCTCGTGCACA\n" +
                "CAATGGAGGCATCAATGGGTAGACCCGAGACGAGGTGTATCAGGTGCGACATGTACTAAA\n" +
                "AGATGAGCTCACAGTGCCATGAAGGTCCGGACAGCGCCCAGCGTGCTTAACACTTG\n").get(0).getSequence(), "ATAAGTCGATCTTTCAAATTAGTCTTCTATAGGATCT");
    }

    public void findOneSubSequenceIndices(String s, String t) {
        int i = 0, j = 0;
        while (j < t.length()) {
            if (s.charAt(i) == t.charAt(j)) {
                System.out.print((i + 1) + " ");
                ++j;
            }
            ++i;
        }
        System.out.println();
    }
}
